<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="view/css/import.css"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
<title>汎用CSV登録</title>
</head>

<body id="layres">
<div class="layreshdr">
	<div>
		項目定義編集
	</div>

	<div id="topMessage">${MESSAGE}</div>
</div>
<div class="layresmaj">
	<form id="form" method="post">
	<input type="hidden" name="Version" value="${empty Version ? '1' : Version}" />
	<div class="layrespri">
		<div>
			<dl class="body">
				<dt><label for="defineName">定義名称:</label></dt>
				<dd><input type="text" name="DefineName" id="defineName" maxlength="40" value="${DefineName}"/></dd>
				<dt><label>有効区分:</label></dt>
				<utl:check var="chk" name="Ykkb" value="1" default="1"/>
				<dd>
				<input type="radio" name="Ykkb" value="${chk}" id="ykkb1"/>
				<label for="ykkb1">有効</label>
				<utl:check var="chk" name="Ykkb" value="0" />
				<input type="radio" name="Ykkb" value="${chk}" id="ykkb0"/>
				<label for="ykkb0">無効</label>
				</dd>
				<dt><label for="schemaName">接続先名:</label></dt>
				<dd><input type="text" name="SchemaName" id="schemaName" value="${SchemaName}"/></dd>
			</dl>
		</div>
		<div>
			<div>抽出項目</div>
			<dl class="body">
				<dt><label for="tableName">テーブル名:</label></dt>
				<dd><input type="text" name="TableName" id="tableName"/><button type="button" class="add">追加</button></dd>
			</dl>
			<table class="fixborder dnd">
				<tr class="nodrop nodrag">
					<th>
						<br />
					</th>
					<th>
						タイトル
					</th>
					<th>
						項目名称
					</th>
					<th width="10px">
						<br />
					</th>
				</tr>
				<c:forEach items="${band.TitleName}" var="bind">
				<tr>
					<td>
						<button type="button" class="remove">削除</button>
					</td>
					<td>
						<input type="text" name="TitleName" maxlength="40" value="${bind.TitleName}" style="width:300px"/>
					</td>
					<td>
						<input type="text" name="ItemName" maxlength="40" value="${bind.ItemName}"/>
					</td>
					<td>
						<br />
					</td>
				</tr>
				</c:forEach>
			</table>
		</div>
		<div>
			<div><label for="queryFrom">クエリ</label></div>
			<div>
				<textarea name="QueryFrom" id="queryFrom" class="resizable" cols="80" rows="15"><c:out value="${noescape.QueryFrom}" escapeXml="true"/></textarea>
			</div>
		</div>
	</div>
	<div class="layressec">
	</div>
	<div class="layrester">
		<div>
			<button type="button" class="append">抽出項目追加</button>
			<button type="button" class="test">クエリテスト</button>
			<button type="button" class="register">登録</button>
		</div>
	</div>
	</form>
</div>
<div class="layresftr">
	<div class="layresftr1">
	</div>
	<div class="layresftr2">
	</div>
</div>

<script src="view/js/jquery.min.js"></script>
<script src="view/js/jquery.tablednd.js"></script>
<script src="view/js/opt/jquery.textarearesizer.min.js"></script>
<script src="view/js/submit.js"></script>
<script>
//<![CDATA[
$(document).ready(function() {
	$('button.add').click(function(){VIEW.submit.post('form', 'add');});
	$('button.test').click(function(){VIEW.submit.post('form', 'test');});
	$('button.append').click(function(){VIEW.submit.post('form', 'append');});
	$('button.register').click(function(){if (window.confirm('登録します。よろしいですか？')) {VIEW.submit.post('form', 'register');}});
	$('button.remove').click(function(){$(this).closest('tr').remove();})
	$('table.dnd').tableDnD();
	if (!$('textarea').css('resize')) {
		$('textarea.resizable').TextAreaResizer();
	}
});
//]]>
</script>
</body>
</html>
